﻿using System.Collections.Generic;
using NExt.data;
using NExt.Core.Model.Base;

namespace NExt.grid
{
    public class GridPanel : GridPanel<GridPanelEvents>
    {
        public string name { get; set; }
    }

    public abstract class GridPanel<TEvents>: Panel<TEvents>
        where TEvents : GridPanelEvents, new()
    {
        protected GridPanel()
        {
            this.columns = new List<object>();
        }
        public string dataMember { get; set; }
        public Store ds { get; set; }
        public bool? enableDragDrop { get; set; }
        public string autoExpandColumn { get; set; }
        public int? autoExpandMax { get; set; }
        public int? autoExpandMin { get; set; }
        public ColumnModel cm { get; set; }
        public IList<object> columns { get; set; }
        public bool? deferRowRender { get; set; }
        public bool? disableSelection { get; set; }
        public bool? enableColumnHide { get; set; }
        public bool? enableColumnMove { get; set; }
        public bool? enableColumnResize { get; set; }
        public bool? enableHdMenu { get; set; }
        public bool? hideHeaders { get; set; }
        public object loadMask { get; set; }
        public int? maxHeight { get; set; }
        public int? minColumnWidth { get; set; }
        public object sm { get; set; }
        public bool? stripeRows { get; set; }
        public bool? trackMouseOver { get; set; }
        public GridView viewConfig { get; set; }
    }

    public class GridPanelEvents : PanelEvents
    {
        public IScript bodyscroll { get; set; }
        public IScript cellclick { get; set; }
        public IScript cellcontextmenu { get; set; }
        public IScript celldblclick { get; set; }
        public IScript cellmousedown { get; set; }
        public IScript click { get; set; }
        public IScript columnmove { get; set; }
        public IScript columnresize { get; set; }
        public IScript contextmenu { get; set; }
        public IScript dblclick { get; set; }
        public IScript headerclick { get; set; }
        public IScript headercontextmenu { get; set; }
        public IScript headerdblclick { get; set; }
        public IScript headermousedown { get; set; }
        public IScript keydown { get; set; }
        public IScript keypress { get; set; }
        public IScript mousedown { get; set; }
        public IScript mouseout { get; set; }
        public IScript mouseover { get; set; }
        public IScript mouseup { get; set; }
        public IScript rowclick { get; set; }
        public IScript rowcontextmenu { get; set; }
        public IScript rowdblclick { get; set; }
        public IScript rowmousedown { get; set; }
        public IScript sortchange { get; set; }
    }
}
